﻿<Window x:Class="Historia.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Historia" Height="350" Width="525" WindowState="Maximized" Loaded="Window_Loaded"  xmlns:my="clr-namespace:Historia.Controls" Icon="/Historia;component/Images/logo128.png">
    <Window.CommandBindings>
        <CommandBinding Command="New" Executed="NewCommand_Executed"></CommandBinding>
        <CommandBinding Command="Open" Executed="OpenCommand_Executed"></CommandBinding>
        <CommandBinding Command="Save" Executed="SaveCommand_Executed" CanExecute="SaveCommand_CanExecute"></CommandBinding>
        <CommandBinding Command="SaveAs" Executed="SaveAsCommand_Executed" CanExecute="SaveCommand_CanExecute"></CommandBinding>
    </Window.CommandBindings>
    
    <DockPanel Name="dockPanelMain" LastChildFill="true">
        <Menu DockPanel.Dock="Top" Height="26">
            <Menu.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFB7B7FF" Offset="1" />
                    <GradientStop Color="White" Offset="0" />
                </LinearGradientBrush>
            </Menu.Background>
            <MenuItem Header="_Fichier" Name="mnuFichier">
                <MenuItem Header="Nouveau" Name="mnuNouveau" Command="ApplicationCommands.New"></MenuItem>
                <MenuItem Header="Ouvrir" Name="mnuOuvrir" Command="Open"></MenuItem>
                <MenuItem Header="Ouvert récemment" Name="mnuOuvertRecemment"></MenuItem>
                <Separator></Separator>
                <MenuItem Header="Enregistrer" Name="mnuEnregistrer" Command="Save"></MenuItem>
                <MenuItem Header="Enregistrer sous" Name="mnuEnregistrerSous" Command="SaveAs"></MenuItem>
                <Separator></Separator>
                <MenuItem Header="Imprimer" Name="mnuImprimer"></MenuItem>
                <Separator></Separator>
                <MenuItem Header="Information sur le projet" Name="mnuInformationProjet" Click="mnuProjet_Click"></MenuItem>
                <Separator></Separator>
                <MenuItem Header="Quitter" Name="mnuQuitter" Click="mnuQuitter_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Personnages" Name="mnuPersonnages">
                <MenuItem Header="Nouveau personnage" Name="mnuNouveauPersonnage" Click="mnuNouveauPersonnage_Click"></MenuItem>
                <MenuItem Header="Gérer les personnages" Name="mnuGererPersonnages" Click="mnuGererPersonnages_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Lieux" Name="mnuLieux">
                <MenuItem Header="Nouveau lieu" Name="mnuNouveauLieu" Click="mnuNouveauLieu_Click"></MenuItem>
                <MenuItem Header="Gérer les lieux" Name="mnuGererLieux" Click="mnuGererLieux_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Items" Name="mnuItems">
                <MenuItem Header="Nouvel item" Name="mnuNouvelItem" Click="mnuNouvelItem_Click"></MenuItem>
                <MenuItem Header="Gérer les items" Name="mnuGererItems" Click="mnuGererItems_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Fils" Name="mnuFils">
                <MenuItem Header="Nouveau fil" Name="mnuNouveauFil" Click="mnuNouveauFil_Click"></MenuItem>
                <MenuItem Header="Gérer les fils" Name="mnuGererFils" Click="mnuGererFils_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Recherches" Name="mnuRecherches">
                <MenuItem Header="Nouvelle recherche" Name="mnuNouvelleRecherche" Click="mnuNouvelleRecherche_Click"></MenuItem>
                <MenuItem Header="Gérer les recherches" Name="mnuGererRecherches" Click="mnuGererRecherches_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Aide" Name="mnuAide">
                <MenuItem Header="À propos de ..." Name="mnuAbout" Click="mnuAbout_Click"></MenuItem>
                
            </MenuItem>
        </Menu>
        <ToolBarTray DockPanel.Dock="Top">
        <ToolBar>
            <Button Name="btnNouveau" ToolTip="Créer un nouveau projet" Command="New" Height="24" Width="24">
                <Image Source="/Historia;component/Images/Nouveau.png" Stretch="None"></Image>
            </Button>
            <Button Name="btnOuvrir" ToolTip="Ouvrir un projet existant" Command="Open" Height="24" Width="24">
                <Image Source="/Historia;component/Images/Editer.png" Stretch="None"></Image>
            </Button>
            <Button Name="btnEnregistrer" ToolTip="Enregistrer le projet" Command="Save" Height="24" Width="24">
                <Image Source="/Historia;component/Images/Enregistrer.png" Stretch="None" Style="{StaticResource toolbarImageStyle}"></Image>
                
            </Button>
        </ToolBar>
          </ToolBarTray>
        <Grid Name="grdMain" Visibility="Hidden">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="25*"></ColumnDefinition>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition Width="80*"></ColumnDefinition>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition Width="30*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            
            <Grid Grid.Column="0" Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <my:ctrChapitres x:Name="ctrlChapitres" SelectionChanged="ctrlChapitres_SelectionChanged" BorderThickness="1" BorderBrush="Black" />
            </Grid>
            
            <TextBox Grid.Column="2" Margin="3"></TextBox>
            <GridSplitter Grid.Column="1" Grid.Row="0" ResizeDirection="Columns" Width="3" HorizontalAlignment="Center"></GridSplitter>
            <GridSplitter Grid.Column="3" Grid.Row="0" ResizeDirection="Columns" Width="3" HorizontalAlignment="Center"></GridSplitter>

            <Grid Grid.Column="4" Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
               
                <my:ctrElements Grid.Column="2" Grid.Row="0" x:Name="ctrElements" BorderThickness="1" BorderBrush="Black" AssignElementClick="ctrElements_AssignElementClick" />
            </Grid>
            <my:ctrTexte Grid.Column="2"  x:Name="ctrlTexte" BorderBrush="Black" BorderThickness="1" />
        </Grid>
    </DockPanel>
</Window>
